import 'package:flutter/widgets.dart';
import 'package:mobile_app.core/core/presentation/theme/theme.dart';
import 'package:mobile_app.core/core/presentation/widgets/tiles/base_text_tile.dart';
import 'package:mobile_app.core/core/presentation/widgets/tiles/pressable_tile.dart';

class PressableTextTile extends StatelessWidget {
  const PressableTextTile({
    required this.onPressed,
    this.title,
    this.titleTextStyle,
    this.titleText,
    this.subtitle,
    this.leading,
    this.trailing,
    this.showPremiumBadge = false,
    super.key,
  })  : assert(title == null && titleText != null || title != null && titleText == null);

  final String? title;
  final TextStyle? titleTextStyle;
  final Text? titleText;
  final String? subtitle;
  final Widget? leading;
  final Widget? trailing;
  final VoidCallback? onPressed;
  final bool showPremiumBadge;

  @override
  Widget build(BuildContext context) {
    return PressableTile(
      color: CoreTheme.of(context).tileColor,
      pressedColor: CoreTheme.of(context).pressedTileColor,
      onPressed: onPressed,
      child: BaseTextTile(
        title: title,
        titleTextStyle: titleTextStyle,
        titleText: titleText,
        subtitle: subtitle,
        leading: leading,
        trailing: trailing,
        showPremiumBadge: showPremiumBadge,
      ),
    );
  }
}
